package com.hlkj.pay.enums;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.hlkj.framework.common.valid.IValidEnum;
import lombok.Getter;
/**
 * @author HlpayTeam
 * @date 2024/11/14 16:37
 */
public interface FinanceEnum {
	@Getter
	enum FINANCE_TYPE implements IValidEnum {
		// 1:商户余额 2:商户手续费 3:商户保证金 4:商户营销账号 5:机构分润余额 6:机构在途利润 7:机构冻结金额 8:机构余额
		
		MERCHANT_FEE(2,  "商户手续费"),
		MERCHANT_DEPOSIT(3,  "商户保证金"),
		MERCHANT_MARKET(4,  "商户营销账号"),
		AGENT_TRANSIT(5,  "机构分润余额"),
		AGENT_PROFIT(6,  "机构在途利润"),
		AGENT_FROZEN(7,  "机构冻结金额"),
		AGENT_AMOUNT(8,  "机构余额"),
		
		;
		
		/**
		 * code
		 */
		private Integer code;
		
		/**
		 * 错误提示
		 */
		private String desc;
		
		FINANCE_TYPE(Integer code, String desc) {
			this.code = code;
			this.desc = desc;
		}
		
		public static FINANCE_TYPE from(Integer key) {
			FINANCE_TYPE[] values = FINANCE_TYPE.values();
			for (FINANCE_TYPE deliveryType : values) {
				if (deliveryType.getCode().equals(key)) {
					return deliveryType;
				}
			}
			return null;
		}
	}
}
